<meta charset="UTF-8">
<div class="row">
  <div class="col-sm-2 col-md-2" th:each="c:${booklist}">
    <div class="thumbnail">
      <img data-th-src="'book/download?uuid='+${c.uuid}" alt="图片加载中！">
      <div class="caption">
      	<input type="hidden" th:value="${c.id}" id="bookid">
        <h3 th:text="${c.bookName}"></h3>
     	<h4>作者：<span th:text="${c.author}"></span></h4>
		<h4>出版社：<span th:text="${c.press}"></span></h4>
		<h4>数量：<span th:text="${c.quantity}"></span></h4>
     	  简介：<p th:text="${c.intro}"></p>
        <p><a href="#" class="btn btn-primary" role="button" onclick="borrow()">借书</a></p>
      </div>
    </div>
  </div>
</div>
<script>
function borrow(){
	var bookid = $('#bookid').val();
	$.post('borrowRecord/borrow',{bookid:bookid},
		function(result){
			if(result.success){
				bootbox.alert("申请成功！");
				
			}else{
				bootbox.alert("库存不足！");
			}
		})
}
</script>